import datetime
from django.db import models
from django.template.defaultfilters import default

class SystemStart(models.Model):
    ''' Remembers start of the system '''
    
    started = models.DateTimeField (default = datetime.datetime.now())
    stopped = models.DateTimeField (null=True, blank=True)
    
class Snapshot(models.Model):
    ''' Snapshot of the system '''
    
    system_start = models.ForeignKey ('SystemStart')
    date = models.DateTimeField (default = datetime.datetime.now())
    input_queue_size = models.IntegerField(default=0)
    output_queue_size = models.IntegerField(default=0)
    incoming_connections = models.IntegerField(default=0)
    outgoing_connections = models.IntegerField(default=0)
    msgs_fwd = models.IntegerField(default=0)
    msgs_sent = models.IntegerField(default=0)
    msgs_in_quarantine = models.IntegerField(default=0)
    msgs_deleted = models.IntegerField(default=0)